

        <g:set var="entityName" value="${message(code: 'teacher.label', default: 'Teacher')}" />
            <g:form method="post" >
                <g:hiddenField name="id" value="${teacherInstance?.id}" />
                <g:hiddenField name="version" value="${teacherInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>

                            <tr class="prop">
                                <td valign="top" class="name" colspan="2">
                                    <label for=""><g:message code="teacher.message.require.label" default="【注意】请仔细填写以下资料！" /></label>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="username"><g:message code="teacher.username.label" default="Username" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'username', 'errors')}">
                                    ${teacherInstance?.username}
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="realname"><g:message code="teacher.realname.label" default="Realname" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'realname', 'errors')}">
                                    <g:textField name="realname" maxlength="100" value="${teacherInstance?.realname}" />
                                </td>
                            </tr>
                         
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="mobile"><g:message code="teacher.mobile.label" default="Mobile" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'mobile', 'errors')}">
                                    <g:textField name="mobile" value="${teacherInstance?.mobile}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name" colspan="2">
                                    <label for=""><g:message code="teacher.message.baseinfo.label" default="基本资料和联系方式" /></label>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="courses"><g:message code="teacher.courses.label" default="Courses" /></label>
                                </td>
                                <td valign="top">
                                    <g:each in="${org.grails.plugins.lookups.Lookup.idList('courses')}" status="i" var="courseInstance">
                                        <%
                                        def flag =  teacherInstance.courses.any{
                                            it == courseInstance.value
                                        }
                                        %>
                                        ${courseInstance.value}<g:checkBox name="courses" checked="${flag}" class="checkbox" value="${courseInstance.value}" />
                                    </g:each>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="sex"><g:message code="teacher.sex.label" default="Sex" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'sex', 'errors')}">
                                    <g:each in="['男','女']">
                                        ${it}<g:radio class="radio" name="sex" value="${it}" checked="${teacherInstance.sex==it?true:false}"/>
                                    </g:each>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="personId"><g:message code="teacher.personId.label" default="Person Id" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'personId', 'errors')}">
                                    <g:textField name="personId" value="${teacherInstance?.personId}" />
                                </td>
                            </tr>
                                                    
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="major"><g:message code="teacher.major.label" default="Major" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'major', 'errors')}">
                                    <g:lookupSelect id="major" name="major" realm="major" value="${teacherInstance.major}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="education"><g:message code="teacher.education.label" default="Education" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'education', 'errors')}">
                                    <g:lookupSelect id="education" name="education" realm="education"  value="${teacherInstance.education}"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="area"><g:message code="teacher.area.label" default="Area" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'area', 'errors')}">
                                    <g:lookupSelect id="area" name="area" realm="area" value="${teacherInstance.area}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="teacherType"><g:message code="teacher.teacherType.label" default="Teacher Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'teacherType', 'errors')}">
                                    <g:lookupSelect id="teacherType" name="teacherType" realm="teacherType"  value="${teacherInstance.teacherType}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="postion"><g:message code="teacher.postion.label" default="Postion" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'postion', 'errors')}">
                                    <g:lookupSelect id="postion" name="postion" realm="postion"  value="${teacherInstance.postion}"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="tel"><g:message code="teacher.tel.label" default="Tel" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'tel', 'errors')}">
                                    <g:textField name="tel" value="${teacherInstance?.tel}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="qq"><g:message code="teacher.qq.label" default="Qq" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'qq', 'errors')}">
                                    <g:textField name="qq" value="${teacherInstance?.qq}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="email"><g:message code="teacher.email.label" default="Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'email', 'errors')}">
                                    <g:textField name="email" value="${teacherInstance?.email}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="address"><g:message code="teacher.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" value="${teacherInstance?.address}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="post"><g:message code="teacher.post.label" default="Post" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'post', 'errors')}">
                                    <g:textField name="post" value="${teacherInstance?.post}" />
                                </td>
                            </tr>
                        
                            
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="unit"><g:message code="teacher.unit.label" default="Unit" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'unit', 'errors')}">
                                    <g:textField name="unit" maxlength="250" value="${teacherInstance?.unit}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="experience"><g:message code="teacher.experience.label" default="Experience" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'experience', 'errors')}">
                                    <g:textArea name="experience" cols="40" rows="5" value="${teacherInstance?.experience}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="salary"><g:message code="teacher.salary.label" default="Salary" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'salary', 'errors')}">
                                    <g:textField name="salary" maxlength="50" value="${teacherInstance?.salary}" />元/课时
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="birthday"><g:message code="teacher.birthday.label" default="Birthday" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'birthday', 'errors')}">
                                    <g:datePicker name="birthday" class="select" precision="day" value="${teacherInstance?.birthday}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name" colspan="2">
                                    <label for=""><g:message code="teacher.message.info.label" default="可以填写您的具体要求及自身情况" /></label>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="introduction"><g:message code="teacher.introduction.label" default="Introduction" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: teacherInstance, field: 'introduction', 'errors')}">
                                    <g:textArea name="introduction" cols="40" rows="5" value="${teacherInstance?.introduction}" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                </div>
            </g:form>
